﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Data;
using System.ComponentModel.DataAnnotations;
using BCDto.OA.WorkflowTemplate.WorkflowTemplatePermission;
using BCDto.OA.WorkflowTemplate.WorkflowTemplateFlowStepDesign;
using BCDto.Utils;

namespace BCDto.OA.WorkflowTemplate.WorkflowTemplate
{
	/// <summary>
	/// 工作流模板
	/// </summary>
	public class WorkflowTemplateRequestDto
	{
		/// <summary>
		/// 工作流模板Code
		/// </summary>		
		[Display(Name = "工作流模板Code")]
		[Required(ErrorMessage = "{0} 不应为空")]
		[StringLength(50, MinimumLength = 2, ErrorMessage = "{0} 长度应大于{2} 且小于{1}")]
		public string TemplateCode { get; set; }
		/// <summary>
		/// 工作流模板名称
		/// </summary>		
		[Display(Name = "工作流模板名称")]
		[Required(ErrorMessage = "{0} 不应为空")]
		[StringLength(100, MinimumLength = 2, ErrorMessage = "{0} 长度应大于{2} 且小于{1}")]
		public string TemplateName { get; set; }
		/// <summary>
		/// 工作流模板图标
		/// </summary>		
		[Display(Name = "工作流模板图标")]
		[Required(ErrorMessage = "{0} 不应为空")]
		[Image]
		public string TemplateIcon { get; set; }
		/// <summary>
		/// 工作流模板描述
		/// </summary>		
		[Display(Name = "工作流模板描述")]
		[Required(ErrorMessage = "{0} 不应为空")]
		[StringLength(400, MinimumLength = 2, ErrorMessage = "{0} 长度应大于{2} 且小于{1}")]
		public string TemplateDescription { get; set; }
		/// <summary>
		/// 分类Code
		/// </summary>		
		[Display(Name = "分类Code")]
		[Required(ErrorMessage = "{0} 不应为空")]
		[StringLength(50, MinimumLength = 2, ErrorMessage = "{0} 长度应大于{2} 且小于{1}")]
		public string CategoryCode { get; set; }
		/// <summary>
		/// 分类名称
		/// </summary>		
		[Display(Name = "分类名称")]
		[Required(ErrorMessage = "{0} 不应为空")]
		[StringLength(30, MinimumLength = 2, ErrorMessage = "{0} 长度应大于{2} 且小于{1}")]
		public string CategoryName { get; set; }
		/// <summary>
		/// 是否为基础流程
		/// </summary>		
		[Display(Name = "是否为基础流程")]
		[Required(ErrorMessage = "{0} 不应为空")]
		public bool IsBaseFlow { get; set; }

		/// <summary>
		/// 特殊模板Key
		/// </summary>
		[Display(Name = "特殊")]
		public string SpecificTemplateKey { get; set; }
		/// <summary>
		/// 是否移动端显示
		/// </summary>		
		[Display(Name = "是否移动端显示")]
		[Required(ErrorMessage = "{0} 不应为空")]
		public bool IsMobleShow { get; set; }
		/// <summary>
		/// 允许在我的任务中发起
		/// </summary>		
		[Display(Name = "允许在我的任务中发起")]
		[Required(ErrorMessage = "{0} 不应为空")]
		public bool AllowInitiate { get; set; }
		/// <summary>
		/// 是否所有人员（为否时检查权限配置）
		/// </summary>		
		[Display(Name = "是否所有人员（为否时检查权限配置）")]
		[Required(ErrorMessage = "{0} 不应为空")]
		public bool IsAllPerson { get; set; }
		/// <summary>
		/// 权限配置
		/// </summary>
		[Display(Name = "权限配置")]
		public List<WorkflowTemplatePermissionRequestDto> PermissionConfig { get; set; }
		/// <summary>
		/// 工作流流程设计
		/// </summary>
		[Display(Name = "工作流流程设计")]
		[Required(ErrorMessage = "{0} 不应为空")]
		public WorkflowTemplateFlowStepDesignRequestDto FlowDesign { get; set; }
	}
}

